3.75 \(\int \frac {1+x^2}{1-x^2+x^4} \, dx\)

Optimal. Leaf size=23 \[ \tan ^{-1}\left (2 x+\sqrt {3}\right )-\tan ^{-1}\left (\sqrt {3}-2 x\right ) \]

[Out]

arctan(2*x-3^(1/2))+arctan(2*x+3^(1/2))

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {1161, 618, 204} \[ \tan ^{-1}\left (2 x+\sqrt {3}\right )-\tan ^{-1}\left (\sqrt {3}-2 x\right ) \]

Antiderivative was successfully verified.

[In]

Int[(1 + x^2)/(1 - x^2 + x^4),x]

[Out]

-ArcTan[Sqrt[3] - 2*x] + ArcTan[Sqrt[3] + 2*x]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 1161

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[(2*d)/e - b/c, 2]},
Dist[e/(2*c), Int[1/Simp[d/e + q*x + x^2, x], x], x] + Dist[e/(2*c), Int[1/Simp[d/e - q*x + x^2, x], x], x]] /
; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - a*e^2, 0] && (GtQ[(2*d)/e - b/c, 0] || ( !Lt
Q[(2*d)/e - b/c, 0] && EqQ[d - e*Rt[a/c, 2], 0]))

Rubi steps

\begin {align*} \int \frac {1+x^2}{1-x^2+x^4} \, dx &=\frac {1}{2} \int \frac {1}{1-\sqrt {3} x+x^2} \, dx+\frac {1}{2} \int \frac {1}{1+\sqrt {3} x+x^2} \, dx\\ &=-\operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,-\sqrt {3}+2 x\right )-\operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,\sqrt {3}+2 x\right )\\ &=-\tan ^{-1}\left (\sqrt {3}-2 x\right )+\tan ^{-1}\left (\sqrt {3}+2 x\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 12, normalized size = 0.52 \[ -\tan ^{-1}\left (\frac {x}{x^2-1}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + x^2)/(1 - x^2 + x^4),x]

[Out]

-ArcTan[x/(-1 + x^2)]

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 7, normalized size = 0.30 \[ \arctan \left (x^{3}\right ) + \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)/(x^4-x^2+1),x, algorithm="fricas")

[Out]

arctan(x^3) + arctan(x)

________________________________________________________________________________________

giac [A]  time = 0.17, size = 30, normalized size = 1.30 \[ \frac {1}{4} \, \pi \mathrm {sgn}\relax (x) + \frac {1}{2} \, \arctan \left (\frac {x^{4} - 3 \, x^{2} + 1}{2 \, {\left (x^{3} - x\right )}}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)/(x^4-x^2+1),x, algorithm="giac")

[Out]

1/4*pi*sgn(x) + 1/2*arctan(1/2*(x^4 - 3*x^2 + 1)/(x^3 - x))

________________________________________________________________________________________

maple [A]  time = 0.02, size = 20, normalized size = 0.87 \[ \arctan \left (2 x -\sqrt {3}\right )+\arctan \left (2 x +\sqrt {3}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2+1)/(x^4-x^2+1),x)

[Out]

arctan(2*x-3^(1/2))+arctan(2*x+3^(1/2))

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x^{2} + 1}{x^{4} - x^{2} + 1}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)/(x^4-x^2+1),x, algorithm="maxima")

[Out]

integrate((x^2 + 1)/(x^4 - x^2 + 1), x)

________________________________________________________________________________________

mupad [B]  time = 4.31, size = 7, normalized size = 0.30 \[ \mathrm {atan}\left (x^3\right )+\mathrm {atan}\relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 + 1)/(x^4 - x^2 + 1),x)

[Out]

atan(x^3) + atan(x)

________________________________________________________________________________________

sympy [A]  time = 0.11, size = 7, normalized size = 0.30 \[ \operatorname {atan}{\relax (x )} + \operatorname {atan}{\left (x^{3} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2+1)/(x**4-x**2+1),x)

[Out]

atan(x) + atan(x**3)

________________________________________________________________________________________